---
title: DoesUserExist
summary: Reports whether a user principal can be resolved in the caller-selected domain.
status: draft
owner: "Not determined from source"
last_reviewed: 2026-09-22
---

# DoesUserExist (OP-07)

## Request and response

| Part | Type | Description |
| --- | --- | --- |
| `inUserId` | `String` | The `SamAccountName` to look up. |
| `inExternalDomain` | `Boolean` | Selects `external.saif.com` when `True`, `corp.saif.com` when `False` ([BR-07](../business-rules.md#br-07-the-directory-domain-is-selected-by-the-caller)). |

| Part | Type | Description |
| --- | --- | --- |
| `<return>` | `Boolean` | `True` when a principal resolves for `inUserId` in the selected domain, `False` otherwise. |

## WebMethod attributes

`<WebMethod()>` — bare, no arguments supplied.

## Steps

1. No access check is performed ([BR-06](../business-rules.md#br-06-read-only-directory-queries-are-not-access-controlled)).
2. Call H2 `GetUserPrincipal` with the caller-supplied `inExternalDomain` ([BR-07](../business-rules.md#br-07-the-directory-domain-is-selected-by-the-caller)).
3. Return `False` if the principal is `Nothing`, else return `True` ([BR-21](../business-rules.md#br-21-a-user-exists-when-a-principal-resolves)) — `False` therefore means both "the user is absent" and "the directory was unreachable" (tech debt TD-22, MEDIUM — see [Tech debt](../tech-debt.md)).

## Process flow

```mermaid
flowchart TD
    A["Call DoesUserExist"] --> B["GetUserPrincipal<br>caller-selected domain"]
    B -->|"Nothing"| C["Return False"]
    B -->|"Found"| D["Return True"]
```

## Shared state effects

None — this operation touches no process-wide state; all locals are per-request.

## Error handling

This operation never faults: every branch of `GetUserPrincipal` (H2), including a directory exception, returns `Nothing`, which this operation maps to `False`. See [Faults](../faults.md) for the service-wide fault model.

## Authorization

None in code. This is one of the eleven ungated operations — see [Authentication and authorization](../authentication-authorization.md).

## Related documentation
- [Service index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Activation and hosting](../activation-hosting.md)
- [Operations](../operations.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Authentication and authorization](../authentication-authorization.md)
- [Configuration](../configuration.md)
- [Dependencies](../dependencies.md)
- [Faults](../faults.md)
- [Operational runbook](../operational-runbook.md)
- [Tech debt](../tech-debt.md)

## Sources
- `src\ADUserServices\clsADUserServices.asmx.vb` (lines 342-353)
